/**
 * @author Andreas Lehner
 * @file   RSACrypt.h
 * @brief  Declaration of the class RSACrypt.
 * 
 */
#ifndef RSACRYPT_H
#define RSACRYPT_H

#include <string>
#include "Crypter.h"

/**
 * @class RSACrypt
 * @brief Crypts strings with RSA algorithm
 * Class RSACrypt encrypts and decrypts every ascii character of a string
 * Implements functions getFileExtension of class Crypter
 */
class RSACrypt : public Crypter {
public:
	void Encrypt();
	void Decrypt();

	std::string getFileExtension() const;

private:
	//mE is a public key known by transmitter and receiver (prime)
	static const size_t mE = 7;
	//mD is a private key known by the receiver only (prime)
	static const size_t mD = 23;
	//mN is a public key known by transmitter and receiver
	static const size_t mN = 187;
	//private method for calculating RSA crypted values (encryption and decryption)
	//param number: ascii decimal value
	//param exponent: public key mE or private key mD
	//returns the crypted character
	unsigned char calcRSA(unsigned char number, int const& exponent);
};

#endif